/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package scms;

/**
 * The Product class is a wrapper class for InventoryItem.
 * @author pumped
 */
public class Product {

	private int productID;  //differs from inventory id
	private int backOrder = 0;  //amount on backorder
	private InventoryItem item;

	/**
	 * prints id, name and description of product
	 */
	public void print() //should be inherited
	{
		System.out.println(getID() + "  " + backOrder + "  " + item.getName() + " - " + item.getDescription());
	}

	/**
	 * prints all product details
	 */
	public void printFull() {
		System.out.println("ID: " + productID);
		System.out.println("Name: " + item.getName());
		System.out.println("On Order: " + backOrder);
		System.out.println("Description: " + item.getDescription());
		System.out.println("Quality: " + item.getQuality());
		System.out.println("Quantity: " + item.getQuantity());
	}

	/**
	 * adds to backorder of product
	 * @param amount
	 */
	public void placeOrder(int amount) {
		backOrder = backOrder + amount;
	}

	/**
	 * sets the inventory item product is based on
	 * @param item inventory item
	 */
	public void setItem(InventoryItem item) {
		this.item = item;
	}

	/**
	 * returns inventory item of product
	 * @return inventory item of this product
	 */
	public InventoryItem getItem() {
		return item;
	}

	/**
	 * sets product id
	 * @param productID
	 */
	public void setID(int productID) {
		this.productID = productID;
	}

	/**
	 * returns id of product
	 * @return product id
	 */
	public int getID() {
		return productID;
	}

	/**
	 * returns number of times been ordered
	 * @return number of orders for this product
	 */
	public int getBackOrder() {
		return backOrder;
	}

	/**
	 * set the amount of this item on order
	 * @param backorder
	 */
	public void setBackOrder(int backorder) {
		this.backOrder = backorder;
	}
}
